home *** CD-ROM | disk | FTP | other *** search
/ Gamers Delight 2 / Gamers Delight 2.iso / Aminet / game / board / GNUChess4_0_58.lha / gnuchess-4.0 / WARNING < prev   
Text File  |  1992-08-26  |  1KB  |  29 lines

  1. If you are using gcc (or another ANSI-compatible C compiler) to compile
  2. gnuchess, but the standard C compiler provided on your operating system is not
  3. ANSI-compatible, you may have problems compiling the FIONREAD ioctl in
  4. dspcom.c.  The problem occurs because older versions of the <ioctl.h> header
  5. file took advantage of a C preprocessor feature that no longer works the same
  6. way in ANSI C.  If you have this problem, gnuchess will exit with an error
  7. message referring to FIONREAD whenever you try to run it.
  8.  
  9. This problem is known to occur on SunOS.
  10.  
  11. If you have gcc 2.00 or later, you can work around the problem by including
  12. the "-traditional-cpp" flag on the CFLAGS line in the gnuchess makefile.  Be
  13. sure to remove the .o files after you make this change so they get recompiled.
  14.  
  15. If you don't have gcc 2.00, various other workarounds may be possible; for
  16. instance, you could compile a program that uses FIONREAD with the standard C
  17. compiler for your operating system, find out what value FIONREAD reduces to,
  18. and put this value directly into dspcom.c as a #define.  For instance, the
  19. following program will print out the correct #define:
  20.  
  21. #include <sys/ioctl.h>
  22. #ifdef __STDC__
  23. ERROR Compile me with a non-ANSI compiler!
  24. #endif
  25. main()
  26. {
  27.   printf("#define FIONREAD 0x%x\n", FIONREAD);
  28. }
  29.